package com.example.common.util.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author juzipi
 * @Date 2021/7/29 9:10
 * @Info
 */
public enum OrderStatusEnums {


    UNPAID(0,"已预约未支付"),
    PAID(1,"已支付"),
    TAKE_NUMBER(2,"已取号"),
    CANCEL_RESERVE(-1,"取消预约")

    ;

    private final Integer status;
    private final String comment;

    OrderStatusEnums(Integer status, java.lang.String comment) {
        this.status = status;
        this.comment = comment;
    }

    public Integer getStatus() {
        return status;
    }

    public java.lang.String getComment() {
        return comment;
    }

    public static List<Map<String,Object>> getStatusList(){
        ArrayList<Map<String,Object>> list = new ArrayList<>();
        OrderStatusEnums[] statusEnums = OrderStatusEnums.values();
        for (OrderStatusEnums statusEnum : statusEnums) {
            HashMap<String, Object> hashMap = new HashMap<>();
            hashMap.put("status",statusEnum.getStatus());
            hashMap.put("comment",statusEnum.getComment());
            list.add(hashMap);
        }
        return list;
    }


}
